package com.ymatou.iapi.exp.service;

import java.util.List;

import com.google.gson.reflect.TypeToken;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.database.model.PrivilegeConfig;
import com.ymttest.utils.EnvSetup;
/**
*获取用户经验值Call
*FreeMaker Template自动生成代码
*/
public class GetPrivilegeConfigListCall extends YmatouBaseCall{
	private static String opurl ="api/getPrivilegeConfigList";
	
	public GetPrivilegeConfigListCall() {
		super(EnvSetup.getSystemUrl("exp_iapi"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public String getErrorMessage(){
		return getString("errorMessage");
	}
	public String getErrorCode(){
		return getString("errorCode");
	}
	public String getSuccess(){
		return getString("success");
	}
	public List<PrivilegeConfig> getResult(){
		String result=getJsonObject().get("result").getAsJsonArray().toString();
		List<PrivilegeConfig> re = (List<PrivilegeConfig>) FormatUtil.GSONToObject(result,new TypeToken<List<PrivilegeConfig>>() {}.getType());
		return re;
	}
}